import React, { useEffect } from 'react'

export default function useIntervalJob(fn: () => void, delay = 3000) {
  useEffect(() => {
    const Timer = setInterval(() => {
      fn()
    }, delay)
    return () => {
      clearInterval(Timer)
    }
  }, [])
  return
}
